package org.example.hellomp;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.example.hellomp.entity.User;
import org.example.hellomp.mapper.UserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class test5 {
    @Autowired
    UserMapper userMapper;
    @Test
    public void test01(){
        IPage<User> userIPage = new Page<>(2,2);
        IPage<User> userIPage1 = userMapper.selectPage(userIPage,null);
        System.out.println(userIPage1);
        List<User> records = userIPage1.getRecords();
        long total = userIPage1.getTotal();
        System.out.println(records);
        System.out.println(total);
    }
}
